package controller;

import java.util.ArrayList;
import java.util.List;

import entidade.AbstractModelObject;
import entidade.Divisao;

public class DivisaoList extends AbstractModelObject {
	
	private List<Divisao> m_divisoes = new ArrayList<Divisao>();
	
	public DivisaoList(List<Divisao> lista){
		m_divisoes.addAll(lista);
	}
	
	public void addDivisao(Divisao divisao) {
		List<Divisao> oldValue = m_divisoes;
		m_divisoes = new ArrayList<Divisao>(m_divisoes);
		m_divisoes.add(divisao);
		firePropertyChange("divisoes", oldValue, m_divisoes);
	}

	public void removeDivisao(Divisao Divisao) {
		List<Divisao> oldValue = m_divisoes;
		m_divisoes = new ArrayList<Divisao>(m_divisoes);
		m_divisoes.remove(Divisao);
		firePropertyChange("divisoes", oldValue, m_divisoes);
	}
	
	public Divisao getDivisao(int index) {
		return m_divisoes.get(index);
	}

	public List<Divisao> getDivisoes() {
		return m_divisoes;
	}	

}
